import request from '@/utils/request'

/**
 * 登录
 * @param {object} loginForm 登录表单
 * @returns promise
 */
export const loginAPI = (loginForm) => {
  return request({
    method: 'post',
    url: '/sys/login',
    data: loginForm
  })
}

/**
 * 获取用户基本资料，目的获取用户id
 * @returns promise
 */
export const getUserProfileAPI = () => {
  return request({
    method: 'post',
    url: '/sys/profile'
  })
}

/**
 * 获取用户基本信息
 * @returns promise
 */
export const getUserInfoAPI = (id) => {
  return request({
    method: 'get',
    url: `/sys/user/${id}`
  })
}
